package com.atom.module.coroutine.cancel

import com.atom.module.coroutine.core.OnCancel

sealed class CancelState {

    override fun toString(): String {
        return "CancelState.${this.javaClass.simpleName}"
    }
    // 残缺的
    object InComplete : CancelState()
    // 取消处理
    class CancelHandler(val onCancel: OnCancel) : CancelState()
    // 完成
    class Complete<T>(val value: T? = null, val exception: Throwable? = null) : CancelState()
    // 被取消的
    object Cancelled : CancelState()
}
